//
//  GHTabbarViewController.m
//  GodHorses
//
//  Created by Mac on 2017/11/14.
//  Copyright © 2017年 stoneobs@icloud.com. All rights reserved.
//

#import "TMTabbarViewController.h"
#import "GCFindViewController.h"
#import "GCMineViewController.h"
@interface TMTabbarViewController ()

@end

@implementation TMTabbarViewController
//
- (instancetype)init
{
    self = [super init];
    if (self) {
        self.tabBar.backgroundColor = [UIColor whiteColor];
        self.tabBar.barTintColor = [UIColor whiteColor];
        [[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"Helvetica-Bold" size:11.f], NSForegroundColorAttributeName : TM_secendTextColor} forState:UIControlStateNormal];
        [[UITabBarItem appearance] setTitleTextAttributes:@{ NSForegroundColorAttributeName:TM_ThemeBackGroundColor} forState:UIControlStateSelected];
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self confiChildVC];
    // Do any additional setup after loading the view.
}

- (void)confiChildVC{
    

    [self setTabbarChildController:[GCFindViewController new]
                         itemTitle:@"发现"
                         itemImage:[UIImage imageNamed:@"首页_选中"]
                       selectImage:[UIImage imageNamed:@"首页_选中拷贝"]
                           itemTag:10000];
    
//    [self setTabbarChildController:[UIViewController new]
//                         itemTitle:@"充值"
//                         itemImage:[UIImage imageNamed:@"充值recharge_fill拷贝"]
//                       selectImage:[UIImage imageNamed:@"充值recharge_fill"]
//                           itemTag:10001];
//    [self setTabbarChildController:[UIViewController new]
//                         itemTitle:@"提现"
//                         itemImage:[UIImage imageNamed:@"提现(1)"]
//                       selectImage:[UIImage imageNamed:@"提现(1)拷贝"]
//                           itemTag:10002];
    [self setTabbarChildController:[GCMineViewController new]
                         itemTitle:@"我的"
                         itemImage:[UIImage imageNamed:@"首页_选中"]
                       selectImage:[UIImage imageNamed:@"首页_选中拷贝"]
                           itemTag:10003];
}

- (void)setTabbarChildController:(UIViewController *)controller itemTitle:(NSString *)title itemImage:(UIImage *)image selectImage:(UIImage *)simage itemTag:(NSInteger)tag {
    
    image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    simage = [simage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    STNavigationController *navi = [[STNavigationController alloc] initWithRootViewController:controller];
    navi.tabBarItem = [[UITabBarItem alloc] initWithTitle:title image:image selectedImage:simage];
    navi.tabBarItem.tag = tag;
    [self addChildViewController:navi];
}


@end

